Skip to main content
POST
/
public
/
v1
/
toptimize
/
forecasting
/
inventory
[BETA] Inventory-level Forecasts
curl --request POST \
  --url https://api.topsort.com/public/v1/toptimize/forecasting/inventory \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "inventory": [
    {
      "inventoryType": "category",
      "inventoryValue": "<string>"
    }
  ],
  "timeWindow": 7
}
'
[
  {
    "inventoryType": "category",
    "inventoryValue": "<string>",
    "dailyForecasts": [
      {
        "forecastDate": "2023-12-25",
        "metrics": [
          {
            "metricName": "<string>",
            "values": {
              "forecastValue": 123,
              "forecastIntervalMin": 123,
              "forecastIntervalMax": 123
            }
          }
        ]
      }
    ]
  }
]

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Body

application/json

Request model for batch inventory forecasts.

inventory
InventoryItem · object[]
required

List of inventory type and value combinations to forecast

timeWindow
integer | null
default:7

Number of days in the future to retrieve forecasts for.

Required range: x >= 1

Response

Successful Response

inventoryType
enum<string>
required

The type of inventory

Available options:
category,
search
inventoryValue
string
required

The value of the inventory

dailyForecasts
DailyForecast · object[]
required

List of daily forecasts for this inventory